#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QThreadPool>
#include <QDir>
#include <windows.h>
#include "process.h"
#include "InjectDLL.h"
#include "EjectDLL.h"
namespace Ui
{
    class Widget;
}

class Widget : public QMainWindow
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    // 界面初始化
    void InterfaceInitialization();
    // 对象初始化
    void ObjectInitialization();
    // 按钮信号连接
    void ButtonSignalConnect();
    // 线程信号连接
    void ThreadSignalConnections();
    // 信息更新
    void InfoUpdate(const QString &message);
    void ProcessesUpdate(const QList<QPair<QString, DWORD>> &processes);
    void RenameDllWithQt(const QString& originalDllPath, const QString& renamedDllPath);
    ~Widget();
private slots:
    void DllPathUpdate();
private:
    Ui::Widget *ui;
public:
    // 线程池
    QThreadPool* pool;
    Process* process;
    InjectDLL *inject;
    EjectDLL *eject;
    QDir dir;
    QStringList filters;
    QFileInfoList dllFiles;
    QString dllPath;
    DWORD pid;
};

#endif // MAINWINDOW_H
